local args = {key=KEYS[1],str=ARGV[1]}
local index,size = 1,string.len(args.str)
while(index <= size)
do
	local s,e = string.find(args.str,',',index)
	local v
	if s ~= nil then
		v = string.sub(args.str,index,s - 1)
		index = e + 1
	else
		v = string.sub(args.str,index)
		index = size + 1
	end
	redis.call('ZINCRBY',args.key,0,v)
end
local result = redis.call('ZRANGEBYSCORE',args.key,0,99999999999999)
redis.call('ZINCRBY',args.key,1,result[1])
return result[1]
